package com.nf;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Hello world!
 *
 */
public class App {

    public static void main( String[] args ) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        Girl girl = (Girl)ac.getBean("g1");
        //girl.伪装();
        girl.吃饭();
        girl.逛街();

        //正常而言，ico容器的关闭，不是由程序员决定，
        //而是随着tomcat的关闭，而关闭
        ((ClassPathXmlApplicationContext)ac).close();

    }
}
